package com.liujit.bms.app.controller;

import com.liujit.bms.app.domain.query.BlogMemberMsgQuery;
import com.liujit.bms.app.domain.result.BlogMemberMsgResult;
import com.liujit.bms.app.service.BlogMemberMsgService;
import com.liujit.common.domain.params.BaseParams;
import com.liujit.common.domain.result.PageBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * @Description 博客会员消息管理接口
 * @Author liujun
 * @Date 2021-07-16 15:54:46
 */
@RequiredArgsConstructor
@Api(tags = "博客会员消息管理接口")
@RestController
@RequestMapping("/blog/member/msg")
public class BlogMemberMsgController {

    private final BlogMemberMsgService blogMemberMsgService;

    @ApiOperation(value = "分页查询", notes = "根据博客会员消息分页查询条件，分页查询博客会员消息列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "query", value = "博客会员消息分页查询条件", dataType = "BlogMemberMsgQuery", dataTypeClass = BlogMemberMsgQuery.class, paramType = "query") })
    @GetMapping("/getPage")
    public PageBean<BlogMemberMsgResult> getPage(BlogMemberMsgQuery query) {
        return blogMemberMsgService.getPage(query);
    }

    @ApiOperation(value = "删除", notes = "根据博客会员消息删除请求参数，删除博客会员消息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "params", value = "博客会员消息删除请求参数", dataType = "BaseParams", dataTypeClass = BaseParams.class, paramType = "body") })
    @PostMapping("/del")
    public Boolean del(@RequestBody BaseParams params) {
        return blogMemberMsgService.del(params);
    }

    @ApiOperation(value = "清空", notes = "清空博客会员消息")
    @PostMapping("/clear")
    public Boolean clear() {
        return blogMemberMsgService.clear();
    }
}
